how to set multiple white spaces (ex: tabs) as delimiters in bash's `cut`

Posted by Idlecool on Super User See other posts from Super User or by Idlecool
Published on 2011-01-14T14:38:46Z Indexed on 2011/01/14 14:55 UTC
Read the original article Hit count: 356

Filed under:
|

I want to retrieve the cpu usage/free percentage from mpstat output. The bash cut can be used to retrieve such details but i dont know what should be the delimiter viz.

[idlecool@archbitch proc]$ mpstat | grep "all" | cut -d '$x' -f11

what should be $x so that i can skip white spaces and select value corresponding to %idle?

Output of mpstat:

[idlecool@archbitch proc]$ mpstat 
Linux 2.6.36-ARCH (archbitch)   01/14/11    _i686_  (2 CPU)

19:58:53     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
19:58:53     all    5.51    0.01    2.96    0.84    0.00    0.01    0.00    0.00   90.66

© Super User or respective owner

Related posts about bash

Related posts about text-processors